package org.example.annotaion.value;

import java.lang.reflect.Field;
import java.util.Arrays;

public class ValuesTest {
    public static void main(String[] args) {
        User user=new User();
        ConsAnnotation anno=user.getClass().getAnnotation(ConsAnnotation.class);
        String[] arr=anno.request();
        System.out.println(Arrays.toString(arr));

        try {
            Field f=user.getClass().getDeclaredField("userName");
            Fields anno2=f.getAnnotation(Fields.class);
            user.setUserName(anno2.value());
            System.out.println(user.getUserName());
        } catch (NoSuchFieldException e) {
            throw new RuntimeException(e);
        }
    }
}
